#include <ximera/scripting/lua/virtualmachine.hpp>
#include <ximera/xml/xmldocument.hpp>

#include <luabind/dependency_policy.hpp>

namespace ximera { namespace scripting { namespace lua
{    
    void VirtualMachine::bindXmlLib()
    {
        using namespace xml;
        using namespace luabind;

        module(_state, "ximera")
        [
            namespace_("xml")
            [
                class_<XmlNode>("XmlNode")
                    .def(constructor<>())
                ,
                class_<XmlDocument, XmlNode>("XmlDocument")
                    .def(constructor<>())
                    .def("load", (void (XmlDocument::*)(String const&)) &XmlDocument::load)
                    .def("loadXml", &XmlDocument::loadXml)
            ]
        ];
    }
}}}